{
  const app = new Vue({
    el: '#app',
    created() {
      this.getDataList()
    },
    data: {
      bannerImgList: [],
      navList: [],
      bigimgList: [],
      goodsList: []
    },
    methods: {
      async getDataList() {
        const { data: res } = await axios.get('/page/detail')
        // 获取轮播图数据
        await res.data.pageData.items[1].data.forEach(element => {
          this.bannerImgList.push(element.imgUrl)
        })
        // 轮播图基本设置
        var swiper = new Swiper('.mySwiper', {
          // spaceBetween: 30,
          centeredSlides: true,
          loop: true,
          autoplay: {
            delay: 1000,
            disableOnInteraction: false
          },
          pagination: {
            el: '.swiper-pagination',
            clickable: true
          },
          navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev'
          }
        })
        // 获取导航区数据
        this.navList = res.data.pageData.items[3].data
        // 大图片区域数据
        this.bigimgList = res.data.pageData.items[4].data
        // 商品组区域数据
        this.goodsList = res.data.pageData.items[6].data
      },
      // 商品组点击跳转事件
      gogogo(id) {
        localStorage.setItem('goodsId', id)
        localStorage.removeItem('where')
        location.href = './goods/index.html'
      }
    }
  })
}
